<!DOCTYPE html>
<html>
<head lang="en">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit" />
    <meta name="keywords" content="有糖开放平台" />
    <meta name="description" content="有糖开放平台" />
    <link type="image/x-icon" href="images/favorite.ico" rel="shortcut icon" />
    <title>短信API回调管理 - 有糖开放平台</title>
    <link rel="stylesheet" type="text/css" media="all"  href="css/utouu.jquery.extends.pagenationstable.css" />
    <link rel="stylesheet" type="text/css" media="all"  href="css/ui-dialog.css" />
    <link rel="stylesheet" type="text/css" media="all"  href="css/style.css" />
</head>
<body>

<!-- 右侧悬浮 -->
<div class="warp_right">
    <div class="subPhone bg_icon">
        <div class="phone">400-720-9815 </div>
    </div>
    <div class="subTop bg_icon" id="gotop"></div>
</div>
<!-- 右侧悬浮END -->


<header class="warp_head bg_black"><div class="section">
    <div class="head_logo"><a href="index.html">有糖开放平台</a></div>
    <div class="head_menu">
        <ul>
            <li><a href="index.html">首页</a></li>
            <li><a href="developer.html">开发者中心</a></li>
            <li><a href="manage.html" class="active">管理中心</a></li>
        </ul>
    </div>
    <div class="head_user">
        <a href="" class="hu_register">注册</a>
        <a href="" class="hu_login">登录</a>
        <!--<a href="" class="hu_register">退出</a>
        <a href="" class="hu_user"><img src="images/user.jpg" /></a>-->
    </div>
</div></header>


<div class="layout_manage">
    <div class="section">
        <div class="warp_menu fL">
            <div class="sub_Men">
                <h3>我的应用<i></i></h3>
                <a href="manage.html">安卓应用</a>
                <a href="manage.html">IOS应用</a>
                <a href="manage.html">我的网站</a>
            </div>
            <div class="sub_Menu sub_Menu_active">
                <h3 class="sm_bg2">短信模板<i></i></h3>
                <a href="message.html">短信模板</a>
                <a href="API.html" class="active">短信API回调管理</a>
            </div>
            <div class="sub_Menu">
                <h3 class="sm_bg3">APP推送管理<i></i></h3>
                <a href="pushdata.html">推送配置</a>
            </div>
            <div class="sub_Menu">
                <h3 class="sm_bg4">启动页<i></i></h3>
                <a href="">启动图配置</a>
            </div>
        </div>

        <div class="warp_tab fR">
            <div class="tab_title">短信API回调</div>
            <div class="push_tab">
                <div class="wm_topTipe">
                    <p>现在仅仅支持短信接口回调，只有配置后才可以回调，否则需要手动调用</p>
                </div>
                <div id="push_tab">
                    <a href="javascript:void(0);" class="push_add_btn">创建API回调</a>
                </div>
            </div>

        </div>
    </div>
</div>


<!-- 删除 -->
<div id="wmo_popDel" style="display: none;">
    <div class="wmo_popDel">
        <div>确认要删除该API回调吗？</div>
        <div class="wmo_code">
            <p>验证码 <input type="text" placeholder="请输入下图中的文字" /></p>
            <div class="subCode">
                <img src="images/code.png" />
                <a href="">换一张</a>
            </div>
        </div>
        <div class="wmo_btn">
            <a href="" class="btn_blue">确定</a>
            <a href="" class="btn_grey">取消</a>
        </div>
    </div>
</div>

<!-- 详情弹出框 -->
<div id="wmo_pop" style="display: none;">
    <div class="message_add api_pop">
        <table>
            <tr><td>API类型：</td><td>短信</td></tr>
            <tr><td>回调地址：</td><td><input type="text" placeholder="请填写回调地址"></td></tr>
            <tr><td></td><td><button class="btn_blue">确定</button><button class="btn_grey">取消</button></td></tr>
        </table>
    </div>
</div>



</body>
<script type="text/javascript" src="js/lib.js"></script>
<script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
<script type="text/javascript" src="js/utouu.jquery.extends.pagenationstable.js"></script>
<script type="text/javascript" src="js/gptop.js"></script>
<script>
    $(document).ready(function() {
        $('.push_add_btn').click(function(){
            var d = dialog({
                title:"API回调",
                content:document.getElementById("wmo_pop")
            });
            d.showModal();
        });

        var testJsonData = {
            data: {list: [
                {type:"短信",url:"http://www.baidu.com",date:"2016-11-10  16:25:36"},
                {type:"短信",url:"http://www.baidu.com",date:"2016-11-10  16:25:36"},
                {type:"短信",url:"http://www.baidu.com",date:"2016-11-10  16:25:36"},
                {type:"短信",url:"http://www.baidu.com",date:"2016-11-10  16:25:36"},
                {type:"站内信",url:"http://www.baidu.com",date:"2016-11-10  16:25:36"},
                {type:"站内信",url:"http://www.baidu.com",date:"2016-11-10  16:25:36"}
            ], total: 5},
            success: true,
            resultCode: "1"
        };


        /**测试代码模拟ajax接口*/
        $.ajax = function (opt) {
            console.dir(opt.data);
            opt.beforeSend();
            setTimeout(function () {
                opt.success(testJsonData);
                opt.complete();
            }, 100);
        };

        //列表
        var push_tab = $("#push_tab").utouuPagenationsTable({
            query: false,
            pagenations: {
                enable: true,
                totalPage: 9,
                size: 10,
                sizePropertyName: "size",
                pagePropertyName: "page",
                startPage: 1,
                maxPageNumberCount: 5,
                url: "",
                method: "post",
                queryParameters: {},
                beforeAjaxSucccess: function (data) {
                    return true;
                }
            },

            table: {
                headRow: {
                    cell: ["API类型 ", "回调地址", "创建时间","操作"]
                },
                dataRow: {
                    cell: [
                        "type",
                        "url",
                        "date",
                        {
                            data: function (data) {
                                var c = $('<div class="wm_opreate"></div> ');
                                var a = $('<a href="javascript:void(0);" class="link_pop">编辑</a>').click(function () {
                                    var d = dialog({
                                        title: 'API回调',
                                        content: document.getElementById("wmo_pop")
                                    });
                                    d.showModal();
                                });
                                var del = $('<a href="javascript:void(0);" class="wm_del">删除</a>').click(function () {
                                    var d = dialog({
                                        title: '删除回调',
                                        content: document.getElementById("wmo_popDel")
                                    });
                                    d.showModal();
                                });

                                a.appendTo(c);
                                del.appendTo(c);
                                return c;
                            }
                        }

                    ]
                },
                dataMainList: function (data) {
                    return data.data.list;
                }
            }
        });

    });
</script>
</html>